package com.liqin.nothing.controller;

import com.liqin.nothing.service.TongYiService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;

/**
 * @author gonghl
 */
@RestController
@RequestMapping("/ai")
@RequiredArgsConstructor
public class TongYiController {

    private final TongYiService tongYiService;

    @GetMapping("/init")
    public SseEmitter init(String id) {
        return tongYiService.init(id);
    }

    @GetMapping("/chat")
    public void chat(String id, String message) {
        tongYiService.chat(id, message);
    }

}
